<!DOCTYPE html>
<html lang="cn">
<head>
    <meta charset="UTF-8">
    <meta content="width=device-width, initial-scale=1.0" name="viewport">
    <meta content="ie=edge" http-equiv="X-UA-Compatible">
    <title>Document</title>
</head>
<link href="../layui/css/layui.css" rel="stylesheet">
<body>
<div style="width: 90%;margin: 15px auto;">
    <textarea cols="30" id="edit" name="" rows="10"></textarea>
    <div class="layui-btn-group" style="margin-top: 10px">
        <button class="layui-btn" lay-event="getContent">获取内容</button>
    </div>
</div>

</body>
<script src="../layui/layui.js"></script>
<script>
    /^http(s*):\/\//.test(location.href) || alert('请先部署到 localhost 下再访问');

    layui.extend({
        tinymce: '{/}./tinymce/tinymce'
    }).use(['tinymce', 'util', 'layer','layedit'], function () {

        var tinymce = layui.tinymce;

        var util = layui.util;

        var edit = tinymce.render({
            elem: "#edit",
            height: 600,
            language:'zh_CN',
            images_upload_url: 'http://localhost:8443/upfile/image',
            filename:'file'
        });


        util.event('lay-event', {
            getContent: function () {
                console.log(edit.getContent())
                layer.msg("展开控制台查看")
            }
        });
    });


</script>
</html>